// components/comment/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: [],
      observer: function (val) {
        if (val.length > 0) {
          this.setData({
            items: val
          })
        }
      }
    },
    /**
     * 是否开启缩略
     */
    simple: {
      type: Object,
      value: {
        "status": true,
        "limit": 3
      }
    },
    like: {
      type: Boolean,
      value: true
    },
    del:{
      type: Boolean,
      value: true
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    items: []
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onLike(e) {
      const dataset = e.currentTarget.dataset;
      this.triggerEvent('liketap', dataset, {});
    },
    onReply(e) {
      const dataset = e.currentTarget.dataset;
      this.triggerEvent('replytap', dataset, {});
    },
    onMore(e) {
      const dataset = e.currentTarget.dataset;
      this.triggerEvent('commentmoretap', dataset, {});
    },
    onDel(e) {
      const dataset = e.currentTarget.dataset;
      this.triggerEvent('deltap', dataset, {});
    },
    onChildDel(e) {
      const dataset = e.currentTarget.dataset;
      this.triggerEvent('childDeltap', dataset, {});
    }
  }
})